import React, {Component} from 'react'

import BetCenterRightTab from "../components/betCenterRightTab"
import BetCenterRightContent from "../components/betCenterRightContent"

export default class betCenterRightContent extends Component {
  constructor (props){
   super(props)
   this.state= {

   }
}

  // componentWillReceiveProps(newprops){
  //   if(newprops){

  //   }
  // }

   render() {
    const {body,righttabcontent,righttabindex,righttab,itemcode} = this.props
    // const {hover} = this.state
    //  console.log(body,"123");
     
      if(!body) return <div className="loading-box"><div className="loading-start">
      </div><p className="msg">数据加载中···</p></div>
      if(righttabcontent.xzlxList && itemcode != "BB"){
        // var length = righttabcontent.xzlxList.length
        // var page =  body.length / length
        // // console.log(body.length,length,page,"bodyleng");
        // var bodycontent = body.slice(righttabindex*page,(righttabindex+1)*page)
        var bodycontent = []
            body.map((item,index)=>{
                if(item.id.indexOf(righttabcontent.xzlxList[righttabindex].xzlxCode)>-1){
                  bodycontent.push(item)
                }
            })
        // console.log(bodycontent);
        return  <div>
                  <BetCenterRightTab content={righttabcontent}  righttab={righttab} />
                  <BetCenterRightContent {...this.props} content={bodycontent}/>
          </div>
      }else{
        return <div>
          <BetCenterRightContent {...this.props} content={body}/>
      </div>
      }
   
   }
}